

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>cdt.data &mdash; Causal Discovery Toolbox 0.5.22 documentation</title>
  

  
  <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="_static/custom.css" type="text/css" />

  
  
    <link rel="shortcut icon" href="_static/favicon.png"/>
  
  
  

  
  <!--[if lt IE 9]>
    <script src="_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
        <script src="_static/jquery.js"></script>
        <script src="_static/underscore.js"></script>
        <script src="_static/doctools.js"></script>
        <script src="_static/language_data.js"></script>
        <script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
        <script type="text/x-mathjax-config">MathJax.Hub.Config({"extensions": ["tex2jax.js"], "jax": ["input/TeX", "output/HTML-CSS"], "tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "displayMath": [["$$", "$$"], ["\\[", "\\]"]], "processEscapes": true}, "HTML-CSS": {"fonts": ["TeX"]}})</script>
    
    <script type="text/javascript" src="_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="cdt.utils" href="utils.html" />
    <link rel="prev" title="cdt.independence" href="independence.html" /> 
</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
          

          
            <a href="index.html">
          

          
            
            <img src="_static/banner.png" class="logo" alt="Logo"/>
          
          </a>

          
            
            
              <div class="version">
                0.5.22
              </div>
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul>
<li class="toctree-l1"><a class="reference internal" href="index.html">Causal Discovery Toolbox Documentation</a></li>
</ul>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="tutorial.html">Get started</a></li>
<li class="toctree-l1"><a class="reference internal" href="causality.html">cdt.causality</a></li>
<li class="toctree-l1"><a class="reference internal" href="independence.html">cdt.independence</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">cdt.data</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#causalpairgenerator">CausalPairGenerator</a></li>
<li class="toctree-l2"><a class="reference internal" href="#acyclicgraphgenerator">AcyclicGraphGenerator</a></li>
<li class="toctree-l2"><a class="reference internal" href="#load-dataset">load_dataset</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="utils.html">cdt.utils</a></li>
<li class="toctree-l1"><a class="reference internal" href="metrics.html">cdt.metrics</a></li>
<li class="toctree-l1"><a class="reference internal" href="settings.html">Toolbox Settings</a></li>
<li class="toctree-l1"><a class="reference internal" href="models.html">PyTorch Models</a></li>
<li class="toctree-l1"><a class="reference internal" href="developer.html">Developer Documentation</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="index.html">Causal Discovery Toolbox</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="index.html" class="icon icon-home"></a> &raquo;</li>
        
      <li>cdt.data</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            <a href="_sources/data.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="module-cdt.data">
<span id="cdt-data"></span><h1>cdt.data<a class="headerlink" href="#module-cdt.data" title="Permalink to this headline">¶</a></h1>
<p>This module focusses on data: data generation but also provides the user
with standard and well known datasets, useful for validation and benchmarking.</p>
<p>The generators provide the user the ability to choose which causal mechanism to
be used in the data generation process, as well as the type of noise
contribution (additive and/or multiplicative). Currently, the implemented
mechanisms are (<span class="math notranslate nohighlight">\(+\times\)</span> denotes either addition or multiplication, and
<span class="math notranslate nohighlight">\(\mathbf{X}\)</span> denotes the vector of causes, and <span class="math notranslate nohighlight">\(E\)</span> represents the
noise variable accounting for all unobserved variables):</p>
<ul class="simple">
<li><p>Linear: <span class="math notranslate nohighlight">\(y = \mathbf{X}W +\times E\)</span></p></li>
<li><p>Polynomial: <span class="math notranslate nohighlight">\(y = \left( W_0 + \mathbf{X}W_1 + ...+ \mathbf{X}^d W_d \right) +\times E\)</span></p></li>
<li><p>Gaussian Process: <span class="math notranslate nohighlight">\(y = GP(\mathbf{X}) +\times E\)</span></p></li>
<li><p>Sigmoid: <span class="math notranslate nohighlight">\(y = \sum_i^d W_i * sigmoid(\mathbf{X_i}) +\times E\)</span></p></li>
<li><p>Randomly init. Neural network: <span class="math notranslate nohighlight">\(y = \sigma((\mathbf{X},E) W_{in})W_{out}\)</span></p></li>
</ul>
<p>Causal pairs can be generated using the <code class="docutils literal notranslate"><span class="pre">cdt.data.CausalPairGenerator</span></code> class,
and acyclic graphs can be generated using the <code class="docutils literal notranslate"><span class="pre">cdt.data.AcyclicGraphGenerator</span></code> class.</p>
<div class="section" id="causalpairgenerator">
<h2>CausalPairGenerator<a class="headerlink" href="#causalpairgenerator" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt id="cdt.data.CausalPairGenerator">
<em class="property">class </em><code class="sig-prename descclassname">cdt.data.</code><code class="sig-name descname">CausalPairGenerator</code><span class="sig-paren">(</span><em class="sig-param">causal_mechanism</em>, <em class="sig-param">noise=&lt;function normal_noise&gt;</em>, <em class="sig-param">noise_coeff=0.4</em>, <em class="sig-param">initial_variable_generator=&lt;function gmm_cause&gt;</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cdt/data/causal_pair_generator.html#CausalPairGenerator"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cdt.data.CausalPairGenerator" title="Permalink to this definition">¶</a></dt>
<dd><p>Generates Bivariate Causal Distributions.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>causal_mechanism</strong> (<em>str</em>) – currently implemented mechanisms:
[‘linear’, ‘polynomial’, ‘sigmoid_add’,
‘sigmoid_mix’, ‘gp_add’, ‘gp_mix’, ‘nn’].</p></li>
<li><p><strong>noise</strong> (<em>str</em><em> or </em><em>function</em>) – type of noise to use in the generative process
(‘normal’, ‘uniform’ or a custom noise function).</p></li>
<li><p><strong>noise_coeff</strong> (<em>float</em>) – Proportion of noise in the mechanisms.</p></li>
<li><p><strong>initial_variable_generator</strong> (<em>function</em>) – Function used to init variables
of the graph, defaults to a Gaussian Mixture model.</p></li>
</ul>
</dd>
</dl>
<p class="rubric">Example</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">cdt.data</span> <span class="kn">import</span> <span class="n">CausalPairGenerator</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">generator</span> <span class="o">=</span> <span class="n">CausalPairGenerator</span><span class="p">(</span><span class="s1">&#39;linear&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">data</span><span class="p">,</span> <span class="n">labels</span> <span class="o">=</span> <span class="n">generator</span><span class="o">.</span><span class="n">generate</span><span class="p">(</span><span class="mi">100</span><span class="p">,</span> <span class="n">npoints</span><span class="o">=</span><span class="mi">500</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">generator</span><span class="o">.</span><span class="n">to_csv</span><span class="p">(</span><span class="s1">&#39;generated_pairs&#39;</span><span class="p">)</span>
</pre></div>
</div>
<dl class="py method">
<dt id="cdt.data.CausalPairGenerator.generate">
<code class="sig-name descname">generate</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">npairs</span></em>, <em class="sig-param"><span class="n">npoints</span><span class="o">=</span><span class="default_value">500</span></em>, <em class="sig-param"><span class="n">rescale</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">njobs</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cdt/data/causal_pair_generator.html#CausalPairGenerator.generate"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cdt.data.CausalPairGenerator.generate" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate Causal pairs, such that one variable causes the other.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>npairs</strong> (<em>int</em>) – Number of pairs of variables to generate.</p></li>
<li><p><strong>npoints</strong> (<em>int</em>) – Number of data points to generate.</p></li>
<li><p><strong>rescale</strong> (<em>bool</em>) – Rescale the output with zero mean and unit variance.</p></li>
<li><p><strong>njobs</strong> (<em>int</em>) – Number of parallel jobs to execute. Defaults to
cdt.SETTINGS.NJOBS</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>(pandas.DataFrame, pandas.DataFrame) data and corresponding
labels. The data is at the <code class="docutils literal notranslate"><span class="pre">SampleID,</span> <span class="pre">a</span> <span class="pre">(numpy.ndarray)</span> <span class="pre">,</span> <span class="pre">b</span> <span class="pre">(numpy.ndarray))</span></code>
format.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>tuple</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="cdt.data.CausalPairGenerator.to_csv">
<code class="sig-name descname">to_csv</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">fname_radical</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cdt/data/causal_pair_generator.html#CausalPairGenerator.to_csv"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cdt.data.CausalPairGenerator.to_csv" title="Permalink to this definition">¶</a></dt>
<dd><p>Save data to the csv format by default, in two separate files.</p>
<p>Optional keyword arguments can be passed to pandas.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="acyclicgraphgenerator">
<h2>AcyclicGraphGenerator<a class="headerlink" href="#acyclicgraphgenerator" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt id="cdt.data.AcyclicGraphGenerator">
<em class="property">class </em><code class="sig-prename descclassname">cdt.data.</code><code class="sig-name descname">AcyclicGraphGenerator</code><span class="sig-paren">(</span><em class="sig-param">causal_mechanism</em>, <em class="sig-param">noise='gaussian'</em>, <em class="sig-param">noise_coeff=0.4</em>, <em class="sig-param">initial_variable_generator=&lt;function gmm_cause&gt;</em>, <em class="sig-param">npoints=500</em>, <em class="sig-param">nodes=20</em>, <em class="sig-param">parents_max=5</em>, <em class="sig-param">expected_degree=3</em>, <em class="sig-param">dag_type='default'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cdt/data/acyclic_graph_generator.html#AcyclicGraphGenerator"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cdt.data.AcyclicGraphGenerator" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate an acyclic graph and data given a causal mechanism.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>causal_mechanism</strong> (<em>str</em>) – currently implemented mechanisms:
[‘linear’, ‘polynomial’, ‘sigmoid_add’,
‘sigmoid_mix’, ‘gp_add’, ‘gp_mix’, ‘nn’].</p></li>
<li><p><strong>noise</strong> (<em>str</em><em> or </em><em>function</em>) – type of noise to use in the generative process
(‘gaussian’, ‘uniform’ or a custom noise function).</p></li>
<li><p><strong>noise_coeff</strong> (<em>float</em>) – Proportion of noise in the mechanisms.</p></li>
<li><p><strong>initial_variable_generator</strong> (<em>function</em>) – Function used to init variables
of the graph, defaults to a Gaussian Mixture model.</p></li>
<li><p><strong>npoints</strong> (<em>int</em>) – Number of data points to generate.</p></li>
<li><p><strong>nodes</strong> (<em>int</em>) – Number of nodes in the graph to generate.</p></li>
<li><p><strong>parents_max</strong> (<em>int</em>) – Maximum number of parents of a node.</p></li>
<li><p><strong>expected_degree</strong> (<em>int</em>) – Degree (number of edge per node) expected,
only used for erdos graph</p></li>
<li><p><strong>dag_type</strong> (<em>str</em>) – type of graph to generate (‘default’, ‘erdos’)</p></li>
</ul>
</dd>
</dl>
<p class="rubric">Example</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">cdt.data</span> <span class="kn">import</span> <span class="n">AcyclicGraphGenerator</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">generator</span> <span class="o">=</span> <span class="n">AcyclicGraphGenerator</span><span class="p">(</span><span class="s1">&#39;linear&#39;</span><span class="p">,</span> <span class="n">npoints</span><span class="o">=</span><span class="mi">1000</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">data</span><span class="p">,</span> <span class="n">graph</span> <span class="o">=</span> <span class="n">generator</span><span class="o">.</span><span class="n">generate</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">generator</span><span class="o">.</span><span class="n">to_csv</span><span class="p">(</span><span class="s1">&#39;generated_graph&#39;</span><span class="p">)</span>
</pre></div>
</div>
<dl class="py method">
<dt id="cdt.data.AcyclicGraphGenerator.generate">
<code class="sig-name descname">generate</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">rescale</span><span class="o">=</span><span class="default_value">True</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cdt/data/acyclic_graph_generator.html#AcyclicGraphGenerator.generate"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cdt.data.AcyclicGraphGenerator.generate" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate data from an FCM defined in <code class="docutils literal notranslate"><span class="pre">self.init_variables()</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>rescale</strong> (<em>bool</em>) – rescale the generated data (recommended)</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>(pandas.DataFrame, networkx.DiGraph), respectively the
generated data and graph.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>tuple</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="cdt.data.AcyclicGraphGenerator.init_dag">
<code class="sig-name descname">init_dag</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">verbose</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cdt/data/acyclic_graph_generator.html#AcyclicGraphGenerator.init_dag"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cdt.data.AcyclicGraphGenerator.init_dag" title="Permalink to this definition">¶</a></dt>
<dd><p>Redefine the structure of the graph depending on dag_type
(‘default’, ‘erdos’)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>verbose</strong> (<em>bool</em>) – Verbosity</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="cdt.data.AcyclicGraphGenerator.init_variables">
<code class="sig-name descname">init_variables</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">verbose</span><span class="o">=</span><span class="default_value">False</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cdt/data/acyclic_graph_generator.html#AcyclicGraphGenerator.init_variables"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cdt.data.AcyclicGraphGenerator.init_variables" title="Permalink to this definition">¶</a></dt>
<dd><p>Redefine the causes, mechanisms and the structure of the graph,
called by <code class="docutils literal notranslate"><span class="pre">self.generate()</span></code> if never called.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>verbose</strong> (<em>bool</em>) – Verbosity</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="cdt.data.AcyclicGraphGenerator.to_csv">
<code class="sig-name descname">to_csv</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">fname_radical</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cdt/data/acyclic_graph_generator.html#AcyclicGraphGenerator.to_csv"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cdt.data.AcyclicGraphGenerator.to_csv" title="Permalink to this definition">¶</a></dt>
<dd><p>Save the generated data to the csv format by default,
in two separate files: data, and the adjacency matrix of the
corresponding graph.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>fname_radical</strong> (<em>str</em>) – radical of the file names. Completed by
<code class="docutils literal notranslate"><span class="pre">_data.csv</span></code> for the data file and <code class="docutils literal notranslate"><span class="pre">_target.csv</span></code> for the
adjacency matrix of the generated graph.</p></li>
<li><p><strong>**kwargs</strong> – Optional keyword arguments can be passed to pandas.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="load-dataset">
<h2>load_dataset<a class="headerlink" href="#load-dataset" title="Permalink to this headline">¶</a></h2>
<dl class="py function">
<dt id="cdt.data.load_dataset">
<code class="sig-prename descclassname">cdt.data.</code><code class="sig-name descname">load_dataset</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">name</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cdt/data/loader.html#load_dataset"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cdt.data.load_dataset" title="Permalink to this definition">¶</a></dt>
<dd><p>Main function of this module, allows to easily import well-known causal
datasets into python.</p>
<dl class="simple">
<dt>Details on the supported datasets:</dt><dd><ul class="simple">
<li><dl class="simple">
<dt><strong>tuebingen</strong>, dataset of 100 real cause-effect pairs</dt><dd><p>J. M. Mooij,
J. Peters, D. Janzing, J. Zscheischler, B. Schoelkopf: “Distinguishing
cause from effect using observational data: methods and benchmarks”,
Journal of Machine Learning Research 17(32):1-102, 2016.</p>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt><strong>sachs</strong>, Dataset of flow cytometry, real data,</dt><dd><p>11 variables x 7466
samples; Sachs, K., Perez, O., Pe’er, D., Lauffenburger, D. A., &amp; Nolan,
G. P. (2005). Causal protein-signaling networks derived from
multiparameter single-cell data. Science, 308(5721), 523-529.</p>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt><strong>dream4</strong>, multifactorial artificial data of the challenge.</dt><dd><p>Data generated with GeneNetWeaver 2.0, 5 graphs of 100 variables x 100
samples. Marbach D, Prill RJ, Schaffter T, Mattiussi C, Floreano D,
and Stolovitzky G. Revealing strengths and weaknesses of methods for
gene network inference. PNAS, 107(14):6286-6291, 2010.</p>
</dd>
</dl>
</li>
</ul>
</dd>
</dl>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>name</strong> (<em>str</em>) – Name of the dataset. currenly supported datasets:
[<cite>tuebingen</cite>, <cite>sachs</cite>, <cite>dream4-1</cite>, <cite>dream4-2</cite>, <cite>dream4-3</cite>,
<cite>dream4-4</cite>, <cite>dream4-5</cite>]</p></li>
<li><p><strong>**kwargs</strong> – Optional additional arguments for dataset loaders.
<code class="docutils literal notranslate"><span class="pre">tuebingen</span></code> dataset accepts the <code class="docutils literal notranslate"><span class="pre">shuffle</span> <span class="pre">(bool)</span></code> option to
shuffle the causal pairs and their according labels.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>(pandas.DataFrame, pandas.DataFrame or networkx.DiGraph) Standard
dataframe containing the data, and the target.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>tuple</p>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">cdt.data</span> <span class="kn">import</span> <span class="n">load_dataset</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">s_data</span><span class="p">,</span> <span class="n">s_graph</span> <span class="o">=</span> <span class="n">load_dataset</span><span class="p">(</span><span class="s1">&#39;sachs&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">t_data</span><span class="p">,</span> <span class="n">t_labels</span> <span class="o">=</span> <span class="n">load_dataset</span><span class="p">(</span><span class="s1">&#39;tuebingen&#39;</span><span class="p">)</span>
</pre></div>
</div>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>The ‘Tuebingen’ dataset is loaded with the same label for all samples (1: A causes B)</p>
</div>
</dd></dl>

</div>
</div>


           </div>
           
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="utils.html" class="btn btn-neutral float-right" title="cdt.utils" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="independence.html" class="btn btn-neutral float-left" title="cdt.independence" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <p>
        
        &copy; Copyright 2018, Diviyan Kalainathan, Olivier Goudet

    </p>
  </div>
    
    
    
    Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
    
    <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a>
    
    provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>